﻿using System;

namespace Core
{
    public static class AwakeSystem
    {
        public static void Awake(Entity entity)
        {
            try
            {
                (entity as IAwake)?.Awake();
            }
            catch (Exception ex)
            {
                Log.Error(ex);
            }
        }

        public static void Awake<A>(Entity entity, A a)
        {
            try
            {
                (entity as IAwake<A>)?.Awake(a);
            }
            catch (Exception ex)
            {
                Log.Error(ex);
            }
        }
        public static void Awake<A, B>(Entity entity, A a, B b)
        {
            try
            {
                (entity as IAwake<A, B>)?.Awake(a, b);
            }
            catch (Exception ex)
            {
                Log.Error(ex);
            }
        }
        public static void Awake<A, B, C>(Entity entity, A a, B b, C c)
        {
            try
            {
                (entity as IAwake<A, B, C>)?.Awake(a, b, c);
            }
            catch (Exception ex)
            {
                Log.Error(ex);
            }
        }
    }
}
